<?php
$contenido = get('http://myavscan.net/login.php');
preg_match('/ipt" src="(h[^"]+)/', $contenido, $result);
preg_match('/challenge :[\s\n]+\'([^\']+)/i', get($result[1]), $cont); 
$img = 'http://www.google.com/recaptcha/api/image?c='.$cont[1];
echo '<IMG src="'.$img.'">';


function get($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4');
curl_setopt($ch,CURLOPT_REFERER, 'http://www.google.com');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
?>

<form action="a.php" method="POST" enctype="multipart/form-data">
<input type="text" name="img">
<input type="file" name="archivo">
<input type="hidden" name="cod" value="<?php echo $cont[1]; ?>">
<input type="submit" value="enviar">
</form>